package com.mc.common.designpattern.signleton;

public class Singleton4 {
    //懒汉式式2  如果一直不使用会造成对象自愿浪费
    private static Singleton4 SINGLETON_1;

    private Singleton4() {
    }

    public static synchronized Singleton4 getInstance() {

        if (SINGLETON_1 == null) {
            SINGLETON_1 = new Singleton4();
        }
        return SINGLETON_1;
    }
}
